﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ViewAllConsultant.ascx.cs"
    Inherits="ContractManagementSystem.Controls.ViewAllConsultant" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>

        <script type="text/javascript">
            function confirmPost()
            {
        	    var agree = confirm("Are you sure you want to delete?");
        	    if (agree)
        		    return true;
        	    else
        		    return false;
            }
        </script>

        <asp:Panel runat="server" ID="ViewConsultantPanel">
            <h2 class="divTitle">
                List Consultant</h2>
            <fieldset style="width: 98%; margin: auto; padding-left: 7px; padding-bottom: 10px;"
                class="border">
                <legend style="padding: 0px 5px 0px 5px; text-shadow: 3px 3px 3px #74907A; color: #045D97">
                    <b>Search</b></legend>
                <div class="divSearch">
                    <table style="width: 100%">
                        <tr>
                            <td>
                                FullName:
                                <asp:TextBox runat="server" ID="FullNameTextBoxSearch" AutoPostBack="True" OnTextChanged="FullNameTextBoxTextChanged"></asp:TextBox>
                                <asp:Button ID="Button1" runat="server" Text="Search" />
                            </td>
                            <td style="text-align: right">
                                View:
                                <asp:DropDownList ID="ActiveDropDownList" AutoPostBack="True" runat="server" OnSelectedIndexChanged="ActiveDropDownList_SelectedIndexChanged">
                                    <asp:ListItem>View All</asp:ListItem>
                                    <asp:ListItem>IsActive</asp:ListItem>
                                    <asp:ListItem>InActive</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                    </table>
                </div>
            </fieldset>
            <asp:ListView runat="server" ItemPlaceholderID="NewItem" ID="ViewAllConsultantListView"
                OnItemDeleting="ViewAllConsultantListView_OnItemDeleting" OnItemEditing="ViewAllConsultantListView_OnItemEditing">
                <LayoutTemplate>
                    <table id="table">
                        <tr>
                            <th>
                                <asp:LinkButton runat="server" ToolTip="Sort" ID="LinkButton1">
                                    FullName
                                </asp:LinkButton>
                                <asp:Image CssClass="img" runat="server" ID="SortFullName" ImageUrl="../App_Themes/Admin/Image/down.png" />
                            </th>
                            <th>
                                <asp:LinkButton runat="server" ToolTip="Sort" ID="LinkButton98">
                                    BirthDate
                                </asp:LinkButton>
                                <asp:Image CssClass="img" runat="server" ID="Image1" ImageUrl="../App_Themes/Admin/Image/down.png" />
                            </th>
                            <th>
                                <asp:LinkButton runat="server" ToolTip="Sort" ID="LinkButton2">
                                    Gender
                                </asp:LinkButton>
                                <asp:Image CssClass="img" runat="server" ID="Image2" ImageUrl="../App_Themes/Admin/Image/down.png" />
                            </th>
                            <th>
                                <asp:LinkButton runat="server" ToolTip="Sort" ID="LinkButton3">
                                    Email
                                </asp:LinkButton>
                                <asp:Image CssClass="img" runat="server" ID="Image3" ImageUrl="../App_Themes/Admin/Image/down.png" />
                            </th>
                            <th>
                                <asp:LinkButton runat="server" ToolTip="Sort" ID="LinkButton4">
                                    PhoneNumber
                                </asp:LinkButton>
                                <asp:Image CssClass="img" runat="server" ID="Image4" ImageUrl="../App_Themes/Admin/Image/down.png" />
                            </th>
                            <th>
                                Action
                            </th>
                        </tr>
                        <tr>
                            <asp:PlaceHolder runat="server" ID="NewItem"></asp:PlaceHolder>
                        </tr>
                    </table>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr class="odd">
                        <td class="columnList">
                            <asp:Label runat="server" ID="ConsultantId" Visible="False" Text='<%#Eval("ConsultantId") %>'></asp:Label>
                            <asp:Label runat="server" ID="FullName" Text='<%#Eval("FullName") %>'></asp:Label>
                        </td>
                        <td>
                            <asp:Label runat="server" ID="BirthDate" Text='<%#Eval("BirthDate","{0: MM/dd/yyyy}") %>'></asp:Label>
                        </td>
                        <td class="columnList">
                            <asp:Label runat="server" ID="Gender" Text='<%#Eval("Gender") %>'></asp:Label>
                        </td>
                        <td class="columnList">
                            <asp:Label runat="server" ID="Email" Text='<%#Eval("Email") %>'></asp:Label>
                        </td>
                        <td class="columnList">
                            <asp:Label runat="server" ID="PhoneNumber" Text='<%#Eval("PhoneNumber")%>'></asp:Label>
                            <asp:Label runat="server" ID="IsActive" Visible="False" Text='<%#Eval("IsActive")%>'></asp:Label>
                        </td>
                        <td>
                            <div style="text-align: center">
                                <asp:LinkButton runat="server" ToolTip="Edit" ID="editLinkButton" CommandName="Edit"
                                    CssClass="edit" OnCommand="EditLinkButton_OnCommand" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"STT" )%>'></asp:LinkButton>
                                <asp:LinkButton runat="server" ToolTip="Delete" ID="deleteButton" CommandName="Delete"
                                    CssClass="delete" OnClientClick="return confirmPost()" OnCommand="DeleteButton_OnCommand"
                                    CommandArgument='<%# DataBinder.Eval(Container.DataItem,"ConsultantId" )%>'></asp:LinkButton>
                            </div>
                        </td>
                    </tr>
                </ItemTemplate>
                <AlternatingItemTemplate>
                    <tr class="alt">
                        <td class="columnList">
                            <asp:Label runat="server" ID="ConsultantId" Visible="False" Text='<%#Eval("ConsultantId") %>'></asp:Label>
                            <asp:Label runat="server" ID="FullName" Text='<%#Eval("FullName") %>'></asp:Label>
                        </td>
                        <td>
                            <asp:Label runat="server" ID="BirthDate" Text='<%#Eval("BirthDate","{0: MM/dd/yyyy}") %>'></asp:Label>
                        </td>
                        <td class="columnList">
                            <asp:Label runat="server" ID="Gender" Text='<%#Eval("Gender") %>'></asp:Label>
                        </td>
                        <td class="columnList">
                            <asp:Label runat="server" ID="Email" Text='<%#Eval("Email") %>'></asp:Label>
                        </td>
                        <td class="columnList">
                            <asp:Label runat="server" ID="PhoneNumber" Text='<%#Eval("PhoneNumber")%>'></asp:Label>
                            <asp:Label runat="server" ID="IsActive" Visible="False" Text='<%#Eval("IsActive")%>'></asp:Label>
                        </td>
                        <td>
                            <div style="text-align: center;">
                                <asp:LinkButton runat="server" ToolTip="Edit" ID="editLinkButton" CommandName="Edit"
                                    CssClass="edit" OnCommand="EditLinkButton_OnCommand" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"STT") %>'></asp:LinkButton>
                                <asp:LinkButton runat="server" ToolTip="Delete" ID="deleteButton" CommandName="Delete"
                                    CssClass="delete" OnClientClick="return confirmPost()" OnCommand="DeleteButton_OnCommand"
                                    CommandArgument='<%# DataBinder.Eval(Container.DataItem,"ConsultantId" )%>'></asp:LinkButton>
                            </div>
                        </td>
                    </tr>
                </AlternatingItemTemplate>
            </asp:ListView>
            <div class="divPage">
                <asp:LinkButton ID="FirstPageButton" Text="First" runat="server" OnClick="FirstPageButton_Click" />
                <asp:LinkButton ID="PreviewPageButton" Text="Preview" runat="server" OnClick="PreviewPageButton_Click" />
                <asp:Label CssClass="curent" ID="PageLabel" runat="server"></asp:Label>
                <asp:LinkButton ID="NextPageButton" Text="Next" runat="server" OnClick="NextPageButton_Click" />
                <asp:LinkButton ID="LastPageButton" Text="Last" runat="server" OnClick="LastPageButton_Click" />
            </div>
        </asp:Panel>
        <asp:Panel runat="server" ID="EditConsultantPanel">
            <div class="divWrap">
                <h1 class="title">
                    Edit Consultant</h1>
                <br />
                <table style="width: 35%; height: 100%; margin: 0 auto">
                    <tr>
                        <td>
                            <asp:TextBox ID="ConsultantIdTextBox" Visible="False" runat="server"></asp:TextBox>BirthDate:
                        </td>
                        <td>
                            <asp:TextBox ID="BirthDateTextBox" Enabled="False" BackColor="white" runat="server"></asp:TextBox>
                            <asp:ImageButton ID="Image" runat="server" CssClass="calender" ImageUrl="~/Images/calendar.png" />
                            <cc1:CalendarExtender ID="CalendarExtender1" CssClass="cal_Theme1" runat="server"
                                TargetControlID="BirthDateTextBox" PopupButtonID="Image" PopupPosition="Right">
                            </cc1:CalendarExtender>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            FullName:
                        </td>
                        <td>
                            <asp:TextBox ID="FullNameTextBox" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Gender:
                        </td>
                        <td>
                            <asp:DropDownList ID="GenderDropDownList" runat="server">
                                <asp:ListItem>Male</asp:ListItem>
                                <asp:ListItem>Female</asp:ListItem>
                                <asp:ListItem>Other</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Email:
                        </td>
                        <td>
                            <asp:TextBox ID="EmailTextBox" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            PhoneNumber:
                        </td>
                        <td>
                            <asp:TextBox ID="PhoneNumberTextBox" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            IsActive:
                        </td>
                        <td>
                            <asp:DropDownList ID="IsActiveDropDownList" runat="server">
                                <asp:ListItem>True</asp:ListItem>
                                <asp:ListItem>False</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="MessageLabel" runat="server"></asp:Label>
                        </td>
                        <td>
                            <asp:Button ID="Submit" runat="server" Text="Submit" OnClick="Submit_Click" />
                            <asp:Button ID="Back" runat="server" Text="Back" OnClick="Back_OnClick" />
                        </td>
                    </tr>
                </table>
            </div>
        </asp:Panel>
    </ContentTemplate>
</asp:UpdatePanel>
